﻿using YiShop.System.Repositories;

namespace YiShop.System.Services
{
    public class SysPostService : BaseService<SysPost, SysPostDto>
    {
        public SysPostService(SysPostRepository sysPostRepository)
        {
            BaseRepo = sysPostRepository;
        }

        public async Task<List<long>> GetPostIdsListByUserId(long userId)
        {
            var arr = await GetDtoListAsync(new SysPostDto { UserId = userId });
            return arr.Where(p => p.PostId.HasValue).Select(p => p.PostId!.Value).Distinct().ToList();
        }
    }
}
